import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppComponent } from './app.component';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { HttpClientModule } from '@angular/common/http';
import { NgZorroAntdModule, NZ_I18N, zh_CN } from 'ng-zorro-antd';
import { registerLocaleData } from '@angular/common';
import zh from '@angular/common/locales/zh';
import { AppRoutingModule } from './app-routing.module';

import { HTTP_INTERCEPTORS } from '@angular/common/http';
import { NetInterceptorService } from './services/net-interceptor.service';

import { NavbarComponent } from './components/navbar/navbar.component';
import { IndexComponent } from './pages/index/index.component';
import { LoginComponent } from './pages/login/login.component';
import { RoleListComponent } from './components/role-list/role-list.component';
import { UserListComponent } from './components/user-list/user-list.component';
import { MetaListComponent } from './components/meta-list/meta-list.component';
import { MenuListComponent } from './components/menu-list/menu-list.component';
import { MenuTreeComponent } from './components/menu-tree/menu-tree.component';
import { HomeComponent } from './components/home/home.component';
import { TimePipe } from './pipes/time.pipe';
import { BMapComponent } from './components/b-map/b-map.component';
import { StaticListComponent } from './components/static-list/static-list.component';
import { UploadComponent } from './components/upload/upload.component';

registerLocaleData(zh);

@NgModule({
  declarations: [
    AppComponent,
    NavbarComponent,
    IndexComponent,
    LoginComponent,
    RoleListComponent,
    UserListComponent,
    MetaListComponent,
    MenuListComponent,
    MenuTreeComponent,
    HomeComponent,
    TimePipe,
    BMapComponent,
    StaticListComponent,
    UploadComponent
  ],
  imports: [
    BrowserModule,
    BrowserAnimationsModule,
    FormsModule,
    ReactiveFormsModule,
    HttpClientModule,
    NgZorroAntdModule,
    AppRoutingModule
  ],
  providers: [
    { provide: NZ_I18N, useValue: zh_CN },
    { provide: HTTP_INTERCEPTORS, useClass: NetInterceptorService, multi: true }
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }
